import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import VueI18n from 'vue-i18n'

Vue.use(ElementUI);

Vue.use(VueI18n);
const i18n = new VueI18n({
    locale: localStorage.getItem('language') || 'zh', //从localStorage里获取用户中英文选择，没有则默认中文
    messages: {
        'zh': require('./lang/zh'),
        'en': require('./lang/en')
    }
})

import { getErrorCode } from "./api/login";
getErrorCode().then((res) => {
    Vue.prototype.errorCode = res.data;
    localStorage.setItem('errorCode', JSON.stringify(res.data))
});

Vue.config.productionTip = false

new Vue({
    i18n,
    render: h => h(App),
}).$mount('#app')